Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec: Fix inconsistency with transient publishes functionality (RTL11) #470

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

mattheworiordan
Copy link
Member

See #323

Messages should no longer be NACK’ed when a channel becomes detached given we can continue to publish in the detached state

@mattheworiordan mattheworiordan temporarily deployed to ably-docs-pr-470 July 22, 2018 13:36 Inactive
@mattheworiordan mattheworiordan changed the title spec: Fix inconsistency with transient publishes functionality spec: Fix inconsistency with transient publishes functionality (RTL11) Jul 22, 2018
@SimonWoolf
Copy link
Member

SimonWoolf commented Jul 23, 2018

all messages that are still queued for send on that channel

Given transient publishes, is "messages queued for send on that channel" still a useful concept? Why would a client library need a channel-specific queue now, rather than only have the connection-wide queue?

(Especially if we want to have behavioural consistency with the proposed client#publish functionality, we need as little per-channel state as possible)

Edit: answering my own question, it's still needed for presence actions per RTP16b

@@ -459,7 +459,7 @@ h3(#realtime-channel). Channel
** @(RTL3b)@ If the connection state enters the @CLOSED@ state, then an @ATTACHING@ or @ATTACHED@ channel state will transition to @DETACHED@
** @(RTL3c)@ If the connection state enters the @SUSPENDED@ state, then an @ATTACHING@ or @ATTACHED@ channel state will transition to @SUSPENDED@
** @(RTL3d)@ If the connection state enters the @CONNECTED@ state, then a @SUSPENDED@ channel will initiate an attach operation and transition to @ATTACHING@. If the attach operation times out, the channel should return to the @SUSPENDED@ state (see "RTL4f":#RTL4f).
* @(RTL11)@ If a channel enters the @DETACHED@, @SUSPENDED@ or @FAILED@ state, then all messages that are still queued for send on that channel should be deleted from the queue triggering a failure for the publish or presence methods invoked for those messages
* @(RTL11)@ If a channel enters the @SUSPENDED@ or @FAILED@ state, then all messages that are still queued for send on that channel should be deleted from the queue triggering a failure for the publish or presence methods invoked for those messages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So: this spec item is now only useful for PresenceMessages, as Messages are no-longer per-channel queued. (Don't think we need it for connection-queued messages -- a channel isn't going enter the suspended or failed state when the connection isn't connected except as a result of the connection entering the suspended or failed states, at which point connection-queued messages will be failed anyway). But for PresenceMessages this change is wrong, they should be failed when the channel is detached.

How about:
* @(RTL11)@ If a channel enters the @DETACHED@, @SUSPENDED@ or @FAILED@ state, then all presence actions that are still queued for send on that channel per "RTP16b":#RTP16b should be deleted from the queue, and any callback passed to the corresponding presence method invocation should be called with an @ErrorInfo@ indicating the failure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So: this spec item is now only useful for PresenceMessages, as Messages are no-longer per-channel queued.

Yes, I suppose that is correct.

Odd that we now have two mechanisms for delivering messages on channels, but it's necessary.

@paddybyers you happy with @SimonWoolf's suggested change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paddybyers you happy with @SimonWoolf's suggested change?

lgtm

@mattheworiordan
Copy link
Member Author

Given transient publishes, is "messages queued for send on that channel" still a useful concept? Why would a client library need a channel-specific queue now, rather than only have the connection-wide queue?

It doesn't. But unless I am mistaken, we don't detail that in our spec as that's an "internals" issue anyway?

(Especially if we want to have behavioural consistency with the proposed client#publish functionality, we need as little per-channel state as possible)
Edit: answering my own question, it's still needed for presence actions per RTP16b

Yup, OK.

@mattheworiordan mattheworiordan force-pushed the transient-publish-spec-fix-pr-323 branch from 4be1ddf to cf9286b Compare July 24, 2018 18:59
@mattheworiordan mattheworiordan temporarily deployed to ably-docs-pr-470 July 24, 2018 18:59 Inactive
See https://github.com/ably/docs/pull/323/files

Messages should no longer be NACK’ed when a channel becomes detached given we can continue to publish in the detached state.  However, this does not apply to presence messages.
@mattheworiordan mattheworiordan force-pushed the transient-publish-spec-fix-pr-323 branch from cf9286b to a3d7171 Compare July 24, 2018 18:59
@mattheworiordan mattheworiordan merged commit a3d7171 into master Jul 24, 2018
@mattheworiordan mattheworiordan deleted the transient-publish-spec-fix-pr-323 branch July 24, 2018 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants